package com.grass.cropTradingCenter.controller.shop;

import com.grass.cropTradingCenter.common.Result;
import com.grass.cropTradingCenter.pojo.entity.MiniShop;
import com.grass.cropTradingCenter.service.MiniShopService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/miniShop")
@Api(tags = "商家 -- 店铺接口")
public class ShopController {


    @Autowired
    MiniShopService miniShopService;

    @PostMapping("/addOrUpdateShop")
    @ApiOperation("添加或更新店铺信息")
    public Result addOrUpdateShop(@RequestBody MiniShop vo){
        miniShopService.addOrUpdateShop(vo);
        return Result.success();
    }

    @GetMapping("/shopDetail")
    @ApiOperation("添加或更新店铺信息")
    public Result<MiniShop> getShopDetail(){
        return Result.success(miniShopService.getShopDetail());
    }
}
